// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

const {ccclass, property} = cc._decorator;
import GamerScript from "./Gmaer Script"

@ccclass
export default class MoveLeft extends cc.Component {

    @property(cc.Label)
    label: cc.Label = null;

    // LIFE-CYCLE CALLBACKS:
    onLoad () {
        this.node.on("mousedown", this.onMouseDown, this)
    }

    onMouseDown() {
        let GamerClass = cc.find("Canvas/Gamer").getComponent(GamerScript)
        GamerClass.moveLeft()
    }
}
